package org.huifei.a10_strategy;

/**
 * @author: huifei
 * @date: 2017-08-30 17:01
 */
public class Test {
    public static void main(String[] args) {

        Strategy add = new Add();
        Environment environment = new Environment(add);
        int sum = environment.calculate(3, 2);
        System.out.println(sum);
        System.out.println("----------------");
        Strategy minus = new Minus();
        environment.setStrategy(minus);
        int result = environment.calculate(3, 2);
        System.out.println(result);



    }
}
